@extends('public')
@section('content')
@section('css')
<style type="text/css">
    .menu_02{ background-color:#31c7f7;width:32px;height:30px; border-radius:3px;padding:4px 6px;color:white;}
    .menu_02:hover{background-color:#47d0fc;}
</style>
<style>
    .menu_01{display:block;background-color:#31c7f7;width:25px;padding:6px 12px; border-radius:3px;color:white;margin-left:18px;margin-top:10px;}
    .menu_01:hover{background-color:#47d0fc;}
</style>
@endsection
<div class="wrap">
    <div class="main_user">
        <div class="main_L" >

            <div class="side_box">
                <div class="user_pic"><img src="{{asset('images/user_pic.jpg')}}" width="80" height="80" /></div>
                <div class="user_name">您好！{{$user->name}}</div>
                <div class="side_nav">
                    <ul>
                        <li>
                            <a href="{{url('user/myinformation')}}"><span>个人资料</span></a>
                        </li>
                        <li>
                            <a href="{{url('user/myorderform')}}"><span>我的订单</span></a>
                        </li>
                        <li>
                            <a href="{{url('user/address')}}"><span>地址管理</span></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="main_R">

            <div class="order_list">
                <table class="table" width="100" border="0" cellspacing="0" cellpadding="0">
                    <a href="{{url('user/update/')}}" class="menu_01">添加</a>

                    <tr>
                        <th class="w_1" style="width: 6em;">ID</th>
                        <th class="w_2">收货人</th>
                        <th class="w_3">所在地区</th>
                        <th class="w_4">详细地址</th>
                        <th class="w_5">邮编</th>
                        <th class="w_6">电话/手机</th>
                        <th class="w_7">操作</th>
                    </tr>
                    @foreach($address as $key=>$value)
                    <tr>
                        <td class="w_1">{{$value->id}}</td>
                        <td class="w_2">{{$value->userName}}</td>
                        <td class="w_3">{{$value->provinceName}}&nbsp;{{$value->cityName}}&nbsp;{{$value->areaName}}</td>
                        <td class="w_4">{{$value->address}}</td>
                        <td class="w_5">{{$value->zipcode}}</td>
                        <td class="w_6">{{$value->phone}}</td>
                        <td>
                            <a href="{{url('user/update/'.$value->id)}}" class="menu_02">修改</a>
                            <a href="{{url('user/delete/'.$value->id)}}" class="menu_02">删除</a>
                        </td>
                    </tr>
                    @endforeach
                </table>
            </div>

        </div>

        <div class="clear"></div>
    </div>
</div>

@stop
@section('js')
    <script type="text/javascript" language="JavaScript">
        $(function(){
            var message = '{{session('message')}}';
            if(message){
                alert(message);
            }
        });
    </script>
@endsection